<link rel="stylesheet" type="text/css" href="<?= base_url() ?>file/js/easyui/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>file/js/easyui/themes/icon.css">

<script type="text/javascript" src="<?= base_url() ?>file/js/easyui/jquery.easyui.min.js"></script>


<div class="box">
	
	 <!-- box / title -->
	<div class="title">
			<h5>Pengambilan Barang Histori</h5>
			<ul class="links">
					<!-- <li><a href="<?=base_url().'index.php/scan/newscan'?>">Buat Nota Pengambilan Barang</a></li>
					<li><a href="<?=base_url().'index.php/scan'?>">Data Pengambilan Barang Hari Ini</a></li>
					<li><a href="<?=base_url().'index.php/scan_history'?>">Data Pengambilan Barang Histori</a></li> -->
			</ul>
	</div>

	<div class="table">
       

		<div class="panel-wrap" style="height: auto">
			
			<div class="panel-header-div">Informasi Teritori</div>
			<div class="panel-body-div">
				<div class="left-panel-body">
					<h2><?=$ter_name?></h2>
				</div>
				
				<div class="right-panel-body">
					<table class="table-right-panel" width="100%" border="solid black 1px">
						<tr align="center" class="tr-colour">
							<th width="50%" align="center">Tanggal</th>
							<th align="center">No Pengambilan Barang</th>
						</tr>
						<tr align="center" class="gray">
							<td width="50%" align="center" style="font-size: 1.3em;">
								<?=date("d-m-Y", strtotime($scan_in->scan_date)).' '.$scan_in->data_timestamp?>
							</td>                    
							<td class="readonly" align="center" >
								<span style="font-size: 16pt"><b><?=$strId?></b></span>
							</td>
							
						</tr>
					</table>
				
				</div>
				
			</div>
		</div>


	
		<div class="panel-wrap" style="height: auto">
			<div class="panel-header-div">Informasi Pengambilan Barang</div>
			<div class="panel-body-div">
				<div class="child-panel-body">
				
					<div class="left-panel-body">

						<table class="table-right-panel" width="60%" border="solid black 1px">
							<tr align="center" class="tr-colour2">
								<th width="20%" align="center">NIK Sales</th>
								<th align="center">Nama Sales</th>
							</tr>
						   
							<tr align="center" class="gray">			
								<td width="50%" class="readonly" align="center" style="font-size: 1.3em;">
									<input type="text" name="output" id="sales-id" disabled="true" class="input-readonly" value="<?=$scan_in->user_id?>">
								</td>                   
								
								<td width="50%" align="center" class="readonly" style="font-size: 1.3em;">
									<input type="text" name="output" id="sales-id" disabled="true" class="input-readonly" value="<?=$sales_name[0]['user_name']?>">									
								</td>
								
							</tr>
						</table>
					</div>
				</div>
			

				<div class="child-panel-body">	
					<table id="table-updateable" class="table-right-panel" width="92%" style="margin-left: 19px;">
						<thead>
							<tr align="center" class="tr-colour3">
								<th style="width:3%">No.</th>
								<th>ICCID</th>
								<th>MDN</th>
								<th>Keterangan</th>
								<th>Grup Item</th>
								<th>Harga (Rp.)</th>
							</tr>
						</thead>
						<tbody>
						<?php
						
							$subtotal = 0;
							$price = 0;
							$x=1;
							foreach ($record as $item) {
							?>
							<tr class="wide scan_in_details">
								<td><?=$x?></td>
								<td><?=$item->iccid?></td>
								<td><?=$item->mdn?></td>
								<td><?=$item->item_name?></td>
								<td><?=$item->item_group_name?></td>
								<td><?=number_format($item->f_get_price, 2, "," , ".")?></td>
							</tr>							
							<?php 
								$subtotal += $item->f_get_price;
								$x++;
							}

						?>
						</tbody>
						
					</table>
						
					<div class="summary" style="float:right;margin-right: 3%;"> 
						 <table width="100%">
							<tr>
								<td>Subtotal</td>
								<td><input style='text-align:right;font-size: 1.3em;' type="text" id="subtotal" name="subtotal" disabled="disabled" value="<?= number_format($subtotal, 2, "," , ".") ?>"/></td>
							</tr>
						</table>
					</div>
					
				
				</div>
			
			
				<div class="child-panel-body-2">
				
					<div class="buttons-2" style="margin: 0 auto">
						<input type="button" value="Back" onclick="location.href='<?=base_url().'index.php/scan_history'?>'" />
					</div>
				</div>
				
			</div>
		</div>

	</div>
</div>